import { BaseEntity } from '../../base/entity/base';
import { Column, Entity, Index } from 'typeorm';

/**
 * 供应商账期
 */
@Entity('supplier_payment_term')
export class SupplierPaymentTermEntity extends BaseEntity {
  @Index()
  @Column({ comment: '供应商ID' })
  supplierId: number;

  @Column({ comment: '账期类型', dict: ['月结', '季结', '年结'], default: 0 })
  termType: number;

  @Column({ comment: '账期天数' })
  termDays: number;

  @Column({ comment: '结算方式', dict: ['电汇', '支票', '汇票'], default: 0 })
  settlementMethod: number;

  @Column({ comment: '开户行', length: 255, nullable: true })
  bankName: string;

  @Column({ comment: '银行账号', length: 50, nullable: true })
  bankAccount: string;
}
